from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    # 启动浏览器（以Chromium为例）
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()
    
    # 导航到目标页面
    page.goto('http://www.baidu.com')
    
    page1 = browser.new_page()
    input("1")
    page1.goto('http://www.baidu.com')
    input("2")
    page.close()
    browser.close()